package com.lagou.es.controller;

import com.lagou.es.service.DataImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

@Controller
public class DataImportController {

    @Autowired
    private DataImportService dataImportService;

    @RequestMapping("/importAll")
    @ResponseBody
    public String importAll() {
        try {
            dataImportService.importAll();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "success";
    }


}
